package concept.chapter7.sorting;

import java.util.Arrays;
import java.util.Comparator;

public class GeoCache
{
	static class Othello implements Comparator<String>
	{
		public int compare(String s, String b)
		{
			return b.compareTo(s);
		}
	}

	public static void main(String[] args)
	{
		String[] s = { "map", "pen", "marble", "key" };
		Othello o = new Othello();
		Arrays.sort(s, o);
		for (String s2 : s)
			System.out.print(s2 + " ");
		System.out.println("\n"+Arrays.binarySearch(s, "map"));
		System.out.println(Arrays.binarySearch(s, "map", o));
	}
}
